package com.lihan.netty;


import io.netty.channel.Channel;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName: UserChannelRel
 * Package: com.lihan.netty
 * Description:
 *  用户id 和 channel的关联关系处理的类
 * @Author 李涵
 * @Create 2025-02-28 9:36
 * @Version 1.0
 */
public class UserChannelRel {
    private static HashMap<String, Channel> manage = new HashMap<>();

    public static void put(String senderId , Channel channel){
        manage.put(senderId,channel);
    }

    public  static Channel get(String sendId){
        return manage.get(sendId);
    }

    /*public static void output(){
        for (Map.Entry<String,Channel> entry:manage.entrySet()) {
            System.out.println("UserId" + entry.getKey()+"ChannelId" + entry.getValue().id().asShortText());
        }
    }*/
}
